<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style></style>
</head>

<body>
    <form action="http://127.0.0.1:8080/v1/imgRouter/upload" method="POST" enctype="multipart/form-data">
        <p>
            <img width="80" src="" alt="">
            <input type="file" name="photo">
        </p>
        <p>
            <input type="text" name="desc" placeholder="请输描述信息">	
        </p>
        <button type="submit">提交</button>
    </form>
    <script>
        let $img=document.getElementsByTagName("img")[0];
        let $input=document.getElementsByName("photo")[0];
        $input.addEventListener("change",changeHandler);
        function changeHandler(){
            //显示选中的图片
            let f=$input.files[0];
            let src=window.URL.createObjectURL(f);
            $img.src=src;
        }
    </script>
    
</body>

</html>